﻿namespace NOAH.CMS.Repository
{
    using System;
    using System.Collections.Generic;
    using System.Linq;

    public class RegistrationRepository : Repository<Registration>
    {
        //public List<Film> GetImageInCategory(int categoryId)
        //{
        //    return (from p in base.dataContext.Films
        //        where p.CategoryId == categoryId
        //        select p).ToList<Film>();
        //}

        //public List<Film> GetImageInHome(int limit)
        //{
        //    List<Film> images = new List<Film>();
        //    return (from p in base.dataContext.Films
        //        where (p.ID >= 0) && (p.Ontop == true)
        //        orderby p.ID descending
        //        select p).Take<Film>(limit).ToList<Film>();
        //}

        public List<RegistrationCourse> GetAllRegistrationDetail(int start, int limit, out int count)
        {
            List<RegistrationCourse> courses = new List<RegistrationCourse>();
            count = dataContext.RegistrationCourses.Count();
            return dataContext.RegistrationCourses.OrderByDescending(p => p.DateCreated).Skip(start).Take(limit).ToList();
        }
    }
}

